package com.coder4j.auth.mapper;

import com.coder4j.starter.mybatis.BaseMapper;
import com.coder4j.auth.entity.AuthOrganizationEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.Arrays;
import java.util.List;

/**
 * 组织
 *
 * @author keller
 * @date 2024-05-09 11:08:09
 */
@Mapper
public interface AuthOrganizationMapper extends BaseMapper<AuthOrganizationEntity> {
    /**
     * 默认查询条件
     *
     * @return
     */
    @Override
    default List<String> defaultCondition() {
        return Arrays.asList(
                " <if test = 'createId!=null'> AND create_id=#{createId} </if>",
                " <if test = 'updateId!=null'> AND update_id=#{updateId} </if>",
                " <if test = 'isDeleted!=null'> AND is_deleted=#{isDeleted} </if>",
                " <if test = 'name!=null'> AND name=#{name} </if>",
                " <if test = 'parentId!=null'> AND parent_id=#{parentId} </if>",
                " <if test = 'uniquePath!=null'> AND unique_path=#{uniquePath} </if>");
    }
}
